package com.zhengxyou.jetpackdemo.work;

import android.content.Context;

import androidx.annotation.NonNull;
import androidx.work.Data;
import androidx.work.Worker;
import androidx.work.WorkerParameters;

public class AWorker extends Worker {
    public static final String KEY_X_ARG = "X";
    public static final String KEY_Y_ARG = "Y";
    public static final String KEY_Z_ARG = "Z";

    public static final String KEY_RESULT = "result";
    public AWorker(@NonNull Context context, @NonNull WorkerParameters workerParams) {
        super(context, workerParams);
    }

    @NonNull
    @Override
    public Result doWork() {
        Data data = new Data.Builder()
                .putInt(KEY_X_ARG, 1)
                .putString(KEY_Y_ARG, "KEY_Y_ARG")
                .putLong(KEY_Z_ARG, 421)
                .build();
        return Result.success(data);
    }
}
